
import {
    postSelectArrange,postAddArrange,postUpdateArrangeState,postDelectArrange,postUpdateArrange} from "../../api/userinfo";
  const arrange = {
      state: {
        arrangeInfo:[]
      },
    
      mutations: {
        SET_ARRANGE(state: any, value: any) {
            state.arrangeInfo = value;
          },
      },
      actions: {
        SET_ARRANGE(content:any){
            return new Promise(async resolve=>{
                  await postSelectArrange().then((res)=>{
                  content.commit("SET_ARRANGE",res.data)
                  console.log(res.data);
                  
                  resolve(res.data)
            })
            })
          },
        SET_ADDARRANGE(content:any,value:any){
          return new Promise (async resolve=>{
            await postAddArrange(value).then((res)=>{
                resolve(res.data)
            })
          })
        },
        SET_UPDATESTATE(content:any,value:any){
          return new Promise (async resolve=>{
            await postUpdateArrangeState(value).then((res)=>{
                resolve(res.data)
            })
          })
        },
        SET_DELETEARRANGE(content:any,value:any){
          return new Promise (async resolve=>{
            await postDelectArrange(value).then((res)=>{
                resolve(res.data)
            })
          })
        },
        SET_UPDATEARRANGE(content:any,value:any){
          return new Promise (async resolve=>{
            await postUpdateArrange(value).then((res)=>{
                resolve(res.data)
            })
          })
        },
        }
    };
export default arrange;

